Internal improvement: Clean up develop and console code #2095
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Left a suggestion.
Would be really nice to have tests for this stuff, but probably out of scope for this PR. 🦅
packages/truffle-core/lib/console.js
Outdated
); | ||
}) | ||
fse | ||
.readFile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use fse.readFileSync
here?
that way we can keep provision
a sync method and remove Promise.all
(maybe rename the promises
array to jsonBlobs
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that would definitely make it a little easier to read! However, I wonder where it is especially useful to use async methods for performance perks...any thoughts @gnidan?
packages/truffle-core/lib/console.js
Outdated
|
||
// If our code includes an await, add special processing to ensure it's evaluated properly. | ||
if (match) { | ||
var assign = match[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here re: var
or let
In an effort to provide better maintainability, this PR seeks to clarify the logic used by the console and develop commands. Callback-style functions are typically converted to Promise-based structures and there are also a handful of syntax updates.